//
//  Api.h
//  iLookForiPhone
//
//  Created by hz on 12-10-18.
//  Copyright (c) 2012年 LavaTech. All rights reserved.
//


#import <Foundation/Foundation.h>

@interface Api : NSObject

+ (void)loadFile:(NSString * _Nullable) plist;
+ (BOOL)setCommonParams:( NSDictionary * _Nullable)params;
+ (nullable NSDictionary *)apiForKey:(NSString * _Nullable)key;
+ (nullable NSString *)urlForKey:(NSString * _Nullable )key;
+ (nullable NSString *)urlForKey:(NSString *_Nullable)key withParam:(NSDictionary *_Nullable)param;
+ (nullable id) request:(NSString * _Nullable)apiKey
             parameters:(nullable id)parameters
                success:(nullable void (^)(id _Nonnull task, id _Nullable json))success
                failure:(nullable void (^)(id _Nullable task,id _Nullable json, NSError * _Nonnull error))failure;
+ (nullable id) request:(NSString * _Nullable)apiKey
             parameters:(nullable id)parameters
               callback:(nullable void (^)(id _Nonnull task, id _Nullable json, NSError * _Nullable error))callback;

+ (void)checkVersionSuccess:(nullable void (^)(id _Nonnull task, id _Nullable json))success
                    failure:(nullable void (^)(id _Nullable task,id _Nullable json, NSError * _Nonnull error))failure;
@end
